package com.fms.controller;

import com.fms.result.ResultData;
import com.fms.dto.OrderDto;
import com.fms.service.ProductOrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/order")
@RequiredArgsConstructor
public class ProductOrderController {

    private final ProductOrderService productOrderService;
    //useless
    @GetMapping("/orderList")
    public ResultData getOrderList(){
        List<OrderDto> productOrders = productOrderService.getOrderList();
        return ResultData.success(productOrders);
    }
}
